"""author: wenyao
   data: 2021/10/28
   project: cjh
"""
#逻辑运算符，短路运算
#and  or  not
#表达式从左至右进行运算，若or的左侧逻辑值为True，则短路后面所有的运算
#若and左侧逻辑值为假，则短路后面所有的and表达，直到结束或者碰到or表达
# >>> result = 3 or print("4") and print("5") and 6
# >>> print(result) 3为真，短路后面所有运算
# 3
# >>> result = 3 and print("4") and print("5") and 6
# 4    print返回值为None 为假 短路后面所有运算
# >>> print(result)
# None
# >>> result = 3 and print("4") and print("5") and 6 or 7
# 4
# >>> print(result)
# 7


# >>> str1 = "abcaaa"
# >>> result = str1.startswith("abc") and "ok" or "error"
# >>> result
# 'ok'
# >>> str1 = "abaaa"
# >>> result
# 'ok'
# >>> result = str1.startswith("abc") and "ok" or "error"
# >>> result
# 'error'
# >>>

# >>> a = b = 500
# >>> a == b
# True
# >>> a is b
# True
# >>> id(a)
# 140560938378288
# >>> id(b)
# 140560938378288
# >>>
# >>> a = 500
# >>> b = 500
# >>> a is b
# False
# >>> a = b = 500
# >>> s is b
# >>> a is b
# True
# >>>
# >>> id(a)
# 140329894988528
# >>> id(b)
# 140329894988624
# >>>



#20<x<30 or x<-100
#y % 2 == 1
#"abc" in str1

#不使用python任何内置方法，就用数学表达式实现
#假设现在有一个数n （100-999）的整数
#153 = 1**3 + 5**3+ 3**3
#num1 = num // 100
#num2 = num % 100 // 10
#num3 = num % 10
#num == num1**3 + num2**3 + num3 **3

#判断一个数是不是整数的表达式，不要python内置type函数判断
# num %1 == 0

##判断一个数开平方之后大于10的表达式  （不要使用python任何内置函数）
#num**0.5 > 10

